package com.zzg.srb.oss.utils;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Author zhengzg
 * @Date 2022/6/3 10:11
 * @Version 1.0
 */
@Data
@Component
@ConfigurationProperties(prefix = "aliyun.oss")
public class OssProperties implements InitializingBean {

    private String endpoint;
    private String accessKeyId;
    private String secret;
    private String bucket;

    public static String ENDPOINT;
    public static String ACCESSKEYID;
    public static String SECRET;
    public static String BUCKET;


    @Override
    public void afterPropertiesSet() throws Exception {
        ENDPOINT = endpoint;
        ACCESSKEYID = accessKeyId;
        SECRET = secret;
        BUCKET = bucket;
    }
}
